#ifndef __SQULIST_H
#define __SQULIST_H

typedef int ElementType;

typedef struct SeqList
{
    ElementType *arr; //动态顺序表
    int size;         //当前表中元素个数
    int capacity;     //当前表容量
} SeqList;

//初始化顺序表
int SeqListInit(SeqList *ps);
//打印顺序表
void SeqListPrint(SeqList *ps);
// 清除顺序表
void SeqListClear(SeqList *ps);
//尾插
int SeqListPushBack(SeqList *ps, ElementType element);
//头插
int SeqListPushFront(SeqList *ps, ElementType element);
//尾删
int SeqListPopBack(SeqList *ps);
//头删
int SeqListPopFront(SeqList *ps);
//任意位置插入一个元素
int SeqListInsert(SeqList *ps, int index, ElementType element);
//任意位置删除一个元素
int SeqListEraseByIndex(SeqList *ps, int index);
//删除指定元素
void SeqListEraseByElement(SeqList *ps, ElementType element);
//查找下标所对应的值
ElementType* SeqListFindByIndex(SeqList *ps, int index );
//查找指定元素下标位置，并统计元素个，个数放在返回结构的首地址
ElementType*  SeqListFindByElement(SeqList *ps, ElementType element);
//查找指定元素下标位置，不统计个数（字符数组实现）
ElementType* SeqListFindByElement2(SeqList *ps, ElementType element);
//通过下标设定值
void SeqListSetValueByIndex(SeqList *ps, int index, ElementType element);
//更改元素值
void SeqListSetValueByElement(SeqList *ps, ElementType oldValue, ElementType newValue);
//求交集
SeqList* SeqListFindIntersection(SeqList *array1,SeqList *array2);
//求并集
SeqList* SeqListFindUnionSet(SeqList *array1,SeqList *array2);


#endif

